const express = require('express')
const router = express.Router()
const userinfo_handler = require('../router_handler/userinfo')

const expressJoi = require('@escook/express-joi')
const {update_userinfo_scheme, update_password_scheme, update_avatar_scheme} = require('../schema/user')

router.get('/userinfo', expressJoi(update_userinfo_scheme), userinfo_handler.getUserInfo)

router.post('/userinfo', expressJoi(update_userinfo_scheme),  userinfo_handler.updteUserInfo)

router.post('/updatepwd', expressJoi(update_password_scheme), userinfo_handler.updatepwd)

router.post('/update/avatar',expressJoi(update_avatar_scheme), userinfo_handler.updateAvatar)

module.exports = router